package org.example.trainTicketSystem.DTO;

import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.math.BigDecimal;

@Data
@AllArgsConstructor
public class TicketDTO {

    @NotNull(message = "列车ID不能为空")
    @Positive(message = "列车ID必须为正整数")
    private Integer trainId;
    @NotBlank(message = "车厢号不能为空")
    private String carriageNumber;
    @NotBlank(message = "座位号不能为空")
    private String seatNumber;
    @NotBlank(message = "座位类型不能为空")
    private String seatType;
    @NotNull(message = "票价不能为空")
    @DecimalMin(value = "0.0", inclusive = false, message = "票价必须大于0")
    private BigDecimal price;
    @NotBlank(message = "车票状态不能为空")
    private String status;

}
